<?php
//ref: http://devzone.zend.com/article/3450 decorators etc.

	class Default_Form_Contact extends Default_Form_Common
	{
	    public function init()
	    {
			parent::init();

	    }

		public function add()
	    {

			$fullname = $this->createElement('text', 'fullname');
			$fullname->setLabel('Fullname')
	               	->setAttrib('size' ,'60')
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

			$email = $this->createElement('text', 'email');
			$email->setLabel('E-mail')
	               	->setAttrib('size' ,'60')
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addValidator('EmailAddress')
	               	->addFilter('StripTags')
	               	->addFilter('StringToLower')
	               	;

			$subject = $this->createElement('text', 'subject');
			$subject->setLabel('Subject')
	               	->setRequired(true)
	               	->setAttrib('size' ,'70')
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;


			$message = $this->createElement('textarea', 'message');
			$message->setLabel('Message')
	               	->setRequired(true)
	               	 ->setAttrib('rows' ,'6')
	               	 ->setAttrib('cols' ,'70')
	               	//->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

			$this->addElement($fullname)
			     ->addElement($email)
			     ->addElement($subject)
			     ->addElement($message)
			     ;



	    }

		public function edit()
	    {
	    	$this->add();

			$editId = $this->createElement('hidden', 'editId');

			$this->addElement($editId);
			$this->removeElement('referer');


	    }

	}
